<?php

include 'config.php';
include 'fonctions/fonctions.php';

include_once 'BD_SQL/Pdo2.php';
include_once 'BD_SQL/Req.php';
include_once 'module_clients/modele/Clients.php';
include_once 'module_techniciens/modele/Techniciens.php';
include_once 'module_codes/modele/Codes.php';
include_once 'module_fichiers/modele/Fichiers.php';
include_once 'module_notes/modele/Notes.php';
include_once 'module_photos/modele/Photos.php';
include_once 'module_techniciens/modele/Authentification.php';

// spl_autoload_register('autoload');

// Fonctionnement des sessions
session_start();
//$login_session = (!empty($_SESSION['nom'])) ? $_SESSION['nom'] : ""; 
$login_session = (!empty($_SESSION['login_session'])) ? $_SESSION['login_session'] : ""; 
// Session reconnu
if(!empty($login_session)) {
	
	$idclientChoisi = 1;
	$affiche = (!empty($_GET['page'])) ? $_GET['page'] : "authentification";
	$titre = $affiche;

	
	switch ($affiche){
	
		case 'authentification':
			include_once  TECHNICIEN.'controleur_authentification.php';
			break;
                    
     case 'techniciens':
			include_once 'structure/en-tete.php';
			include_once TECHNICIEN.'controleur_technicien.php';
			include_once 'structure/pied.php';
			break;
			
		case 'accueil':
			include_once 'structure/en-tete.php';
			include_once CLIENTS.'controleur_accueil.php';
			include_once 'structure/pied.php';
			break;
			
		case 'clients':
			include_once 'structure/en-tete.php';
			include_once CLIENTS.'controleur_clients.php';
			include_once 'structure/pied.php';
			break;
			
		case 'codes':
			include_once 'structure/en-tete.php';
			include_once CODES.'controleur_codes.php';
			include_once 'structure/pied.php';
			break;
						
		case 'photos':
			include_once 'structure/en-tete.php';
			include_once PHOTOS.'controleur_photos.php';
			include_once 'structure/pied.php';
			break;
					
		case 'fichiers':
			include_once 'structure/en-tete.php';
			include_once FICHIERS.'controleur_fichiers.php';
			include_once 'structure/pied.php';
			break;
			
		case 'notes':
			include_once 'structure/en-tete.php';
			include_once NOTES.'controleur_notes.php';
			include_once 'structure/pied.php';
			break;
			
		case 'menu':
			include_once 'structure/en-tete.php';
			include_once CLIENTS.'controleur_clients.php';
			include_once 'structure/pied.php';
			break;
	
		default:
			include_once TECHNICIEN.'controleur_authentification.php';
			break;
	
	}
}

else {

			$titre = "authentification";
			include_once TECHNICIEN.'controleur_authentification.php';
}

?>
